<template>
  <div>
    <table class="table1 owntable mb20 tableLayout" border="0" cellspacing="0" cellpadding="1" width="100%">
      <tr>
        <td width="150">产品留样管理编号</td>
        <td>{{ item.number }}</td>
        <td width="150">留样类别</td>
        <td>{{ sampleList[item.sampleType] }}</td>
      </tr>
      <tr>
        <td>{{ item.sampleType == 0 ? '原材料批号' : '生产批号' }}</td>
        <td>{{ item.batchNumber }}</td>
        <td>管理部门</td>
        <td>{{ item.manageDeptName }}</td>
      </tr>
      <tr>
        <td>负责人</td>
        <td>{{ item.manageUserName }}</td>
        <td>编制部门</td>
        <td>{{ item.createDeptName }}</td>
      </tr>
    </table>
    
    <table class="table1 owntable mb20" border="0" cellspacing="0" cellpadding="1" width="100%" v-for="v in item.sampleList" :key="v.id">
      <tr v-if="item.sampleType == 0">
        <td>原材料名称</td>
        <td>{{ v.productName }}</td>
        <td>原材料规格型号</td>
        <td>{{ v.productSku }}</td>
      </tr>
      <tr v-if="item.sampleType == 0">
        <td>原材料编号</td>
        <td>{{ v.productNumber }}</td>
        <td>检验日期</td>
        <td>{{ v.examinDate }}</td>
      </tr>
      <tr v-if="item.sampleType == 1">
        <td>中间品名称</td>
        <td>{{ v.productName }}</td>
        <td>中间品编号</td>
        <td>{{ v.productNumber }}</td>
      </tr>
      <tr v-if="item.sampleType == 1">
        <td>中间品规格型号</td>
        <td>{{ v.productSku }}</td>
        <td>检验日期</td>
        <td>{{ v.examinDate }}</td>
      </tr>
      <tr v-if="item.sampleType == 2">
        <td>成品名称</td>
        <td>{{ v.productName }}</td>
        <td>成品编号</td>
        <td>{{ v.productNumber }}</td>
      </tr>
      <tr v-if="item.sampleType == 2">
        <td>成品规格型号</td>
        <td>{{ v.productSku }}</td>
        <td>检验日期</td>
        <td>{{ v.examinDate }}</td>
      </tr>
      <tr>
        <td>检验员</td>
        <td>{{ v.examineName }}</td>
        <td>留样数量</td>
        <td>{{ v.sampleQty }}{{ v.unit }}</td>
      </tr>
      <tr>
        <td>留样日期</td>
        <td>{{ v.sampleDate }}</td>
        <td>失效日期</td>
        <td>{{ v.invalidDate }}</td>
      </tr>
      <tr>
        <td>有效期</td>
        <td colspan="3">{{ v.failedQty }}</td>
      </tr>
      <tr>
        <td>是否使用设备</td>
        <td colspan="3"><el-button type="primary" size="mini" plain>展开设备详情</el-button></td>
      </tr>
      <tr v-for="m in v.deviceList" :key="m.id">
        <el-row>
          <el-col :span="8">设备名称</el-col>
          <el-col :span="8">设备型号</el-col>
          <el-col :span="8">设备编号</el-col>
        </el-row>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  props: {
    item: {}
  }
};
</script>

<style></style>
